package com.jianyun.jyzs.http;



import com.jianyun.jyzs.BuildConfig;

import java.io.IOException;

import com.jianyun.jyzs.utils.RceLog;
import okhttp3.Interceptor;
import okhttp3.Request;
import okhttp3.Response;

/**
 * Created by liml on 17/6/1.
 */

public class LInterceptor implements Interceptor {
    private volatile Level level = Level.BODY;

    public enum Level {
        NONE,
        BASIC,
        HEADERS,
        BODY
    }

    @Override
    public Response intercept(Chain chain) throws IOException {
        Level level = this.level;
        Request request = chain.request();
        if (BuildConfig.DEBUG){
            RceLog.d("lml","请求的url="+request.url());
        }
        if (level == Level.NONE) {
            return chain.proceed(request);
        }
        Response response = chain.proceed(request);
        return response;
    }
}